package com.server.cn.controller;

import com.model.cn.entity.Item;
import com.server.cn.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("query")
public class ItemController {

    @Autowired
    private ItemService itemService;

    @PostMapping("/item")
    public Item queryItem(@RequestParam String itemCode) {
        Item item = itemService.selectByItemCode(itemCode);
        return item;
    }

}
